//
//  GDBusStationStatsController.m
//  GraduationDesign
//
//  Created by JiaKang.Zhong on 16/1/5.
//  Copyright © 2016年 JiaKang.Zhong. All rights reserved.
//

#import "GDBusStationStatsController.h"
#import "GDBusStatsViewController.h"
#import "GDBusStationStatsModel.h"
@interface GDBusStationStatsController ()
@property(nonatomic,strong)  UITextField * statsName;
@end

@implementation GDBusStationStatsController

- (void)viewDidLoad {
    [super viewDidLoad];
  

    [self setUpBusStatsUI];
}

#pragma mark 设置UI
-(void) setUpBusStatsUI{
    
    self.view.backgroundColor = [UIColor whiteColor];
//    //   当前城市为：
//    UILabel * nowCity = [[UILabel alloc] initWithFrame:CGRectMake(GDScreenSize.size.width - 120, 70, 150, 30)];
//    nowCity.text = [NSString stringWithFormat:@"当前城市为:%@",self.cityName];
//    nowCity.textColor = [UIColor redColor];
//    [self.view addSubview:nowCity];
    // 站点名称
    UILabel * statLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, GDScreenSize.size.height * 0.1, 200, 30)];
    statLabel.text = @"站点名称:*";
    [self.view addSubview:statLabel];
    // 请输入站点名称,如:省科干学院
    UITextField * statsName = [[UITextField alloc] initWithFrame:CGRectMake(GDScreenSize.size.width*0.5 - 125, CGRectGetMaxY(statLabel.frame) + 20, 250, 40)];
    ;
    statsName.font = [UIFont systemFontOfSize:14];
    statsName.borderStyle = UITextBorderStyleRoundedRect;
    statsName.placeholder = @"请输入站点名称,如:省科干学院";
    statsName.clearButtonMode = UITextFieldViewModeWhileEditing;
    [self.view addSubview:statsName];
    _statsName = statsName;
    // 查询按钮
    UIButton * searchBtn = [[UIButton alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(statsName.frame) + 20, GDScreenSize.size.width - 40, 40)];
    ;
    [searchBtn setTitle:@"查询" forState:UIControlStateNormal];
    [searchBtn setTintColor:[UIColor redColor]];
    [self.view addSubview:searchBtn];
    searchBtn.backgroundColor = [UIColor redColor];
    [searchBtn addTarget:self action:@selector(serachBtnClick) forControlEvents:UIControlEventTouchDown];

    
}

-(void) serachBtnClick{
    
    GDBusStatsViewController * statsViewController = [[GDBusStatsViewController alloc] init];
    statsViewController.statsName = self.statsName.text;
    statsViewController.cityName = self.cityName;
    [self.navigationController pushViewController:statsViewController animated:YES];
   
}




@end
